const Mock = require("mockjs");

const data = Mock.mock({
  "items|15": [
    {
      id: "@integer(5, 100)",
      domain: "@sentence(2, 10)",
      domainName: "xx",
      source: "@sentence(2, 5)",
      netDev: "@sentence(2, 5)",
      importSystem: "@sentence(2, 5)",
      dept2: "@sentence(2, 5)",
      leader: "@sentence(2, 5)",
      riskNum: "@integer(2, 5)",
      riskDoneNum: "@integer(20, 40)",

      "status|1": ["published", "draft", "deleted"],

      createTimeText: "@datetime",
      pageviews: "@integer(300, 5000)",
    },
  ],
});

module.exports = [
  {
    url: "/assets/list",
    type: "post",
    response: (config) => {
      const items = data.items;
      return {
        code: 0,
        msg: "",
        count: items.length,
        data: items,
      };
    },
  },
  {
    url: "/assets/relationship",
    type: "get",
    response: (config) => {
      return {
        code: 0,
        msg: "",
        count: 0,
        data: {
          dept2: "开发部",
          leader: "王刚",
          leaderName: "佳佳",
        },
      };
    },
  },
  {
    url: "/assets/batchReport",
    type: "post",
    response: (config) => {
      return {
        code: 0,
        msg: "",
        count: 0,
        data: {},
      };
    },
  },
  {
    url: "/assets/batchMonitor",
    type: "post",
    response: (config) => {
      return {
        code: 0,
        msg: "",
        count: 0,
        data: {},
      };
    },
  },
  {
    url: "/assets/batchOffline",
    type: "post",
    response: (config) => {
      return {
        code: 0,
        msg: "",
        count: 0,
        data: {},
      };
    },
  },
  {
    url: "/assets/batchOnline",
    type: "post",
    response: (config) => {
      return {
        code: 0,
        msg: "",
        count: 0,
        data: {},
      };
    },
  },
  {
    url: "/assets/detail",
    type: "get",
    response: (config) => {
      return {
        code: 0,
        msg: "",
        count: 0,
        data: {
          ID: "deserunt magna dolore",
          source: "consequat Excepteur dolore",
          domain: "non dolor Lorem",
          domainName: "sed fugiat dolore magna",
          scanDev: "incididunt",
          importSystem: "laborum",
          netDev: "labore laborum reprehenderit ut eu",
          leaderName: "consequat commodo consectetur veniam officia",
          leader: "dolore ex non voluptate",
          dept2: "proident ",
          bpAccount: "do",
          bp: "anim ad aliqua consequat deser",
          pmAccount: "aliqua exercitation officia",
          pmName: "velit deserunt elit in non",
          creator: "adipisicing commodo amet sed",
          noticeUsers: [],
          riskNum: "ut",
          intervalDate: "dolore in do",
          intervalDays: "consectetur sunt exercitation",
          cluster: "aute",
          ctCode: "adipisicing non",
          createTimeText: "mollit aliqua aute occaecat",
          extraData: "laborum dolor culpa",
          remark1: "aliqua mollit in quis labore",
        },
      };
    },
  },
  {
    url: "/assets/save",
    type: "post",
    response: (config) => {
      return {
        code: 0,
        msg: "",
        count: 0,
        data: {},
      };
    },
  },
];
